package ar.pmt.vista.manager.impl;

import java.util.ArrayList;
import java.util.Collection;



import ar.pmt.modelo.beans.Recurso;
import ar.pmt.modelo.businessObject.SrvcControlAvance;
import ar.pmt.vista.beans.RecursoBean;



/**
 * Singleton
 *
 * @author gburgener
 *
 */

public class CommonManagerImpl extends Manager  {


   public Collection<RecursoBean> getRecursosPorPeticion(String unicoIdPeticion) throws Exception {
		SrvcControlAvance srvcControlAvance = (SrvcControlAvance)beanFactory.getBean("srvcControlAvance");
		Collection<Recurso> recursos = srvcControlAvance.obtenerRecursos(unicoIdPeticion);
		Collection<RecursoBean> recursosBean = new ArrayList<RecursoBean>();
		BeanVistaManager.copiarCollectionBeanModeloToBeanVista(recursos, recursosBean, RecursoBean.class);
		return recursosBean;		
   }
   
   public RecursoBean getRecurso(String uid) throws Exception {
		SrvcControlAvance srvcControlAvance = (SrvcControlAvance)beanFactory.getBean("srvcControlAvance");
		Recurso recursos = srvcControlAvance.obtenerRecurso(uid);
		RecursoBean recursosBean = new RecursoBean();
		BeanVistaManager.copiarBeanModeloToBeanVista(recursos, recursosBean);
		return recursosBean;		
  }
   





   
}
